#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/9/15 15:11
# @Author: 刘航
# @Email: xxx@gmail.com
# @File：cule_page.py

"""
线索界面
"""
from pages.cus_mag_pages.base_page import BasePage
from selenium.webdriver.common.by import By
class CulePage(BasePage):
    add_culelocator = (By.XPATH,"/html/body/div[5]/div[2]/div[1]/div/a") #添加线索按钮
    first_cule_locator = (By.XPATH,"/html/body/div[5]/div[3]/div[2]/form/table/tbody/tr[1]")
    first_cule_column_data = (By.TAG_NAME,"td")
    cule_pool_locator = (By.CSS_SELECTOR,".nav-tabs > li:nth-child(2) > a:nth-child(1)") #线索池
    modify_locator = (By.CSS_SELECTOR,".table > tbody:nth-child(3) > tr:nth-child(1) > td:nth-child(12) > a:nth-child(3)")



    def add_cule_btn(self):
        """添加线索按钮"""
        self.driver.find_element(*self.add_culelocator).click()


    def first_cule_data(self):
        """第一条线索数据"""
        element = self.driver.find_element(*self.first_cule_locator)
        data = element.find_elements(*self.first_cule_column_data)
        return data

    def cule_pool_btn(self):
        """线索池按钮"""
        self.driver.find_element(*self.cule_pool_locator).click()

    def modify_btn(self):
        """修改接口"""
        self.driver.find_element(*self.modify_locator).click()

